package demoFactoryProxy;

import com.bit.utils.FileUtils;

public class Test {

    public static void main(String[] args) {
        AdminIUserFactory adminUserFactory = new AdminIUserFactory();
        User admin = adminUserFactory.createUser("zhangsan", 20);

        NormalIUserFactory normalUserFactory = new NormalIUserFactory();
        User normal1 = normalUserFactory.createUser("lisi", 19);
        User normal2 = normalUserFactory.createUser("wangwu", 18);

        ProxyUser proxyUser = new ProxyUser(admin);
        proxyUser.borrowedBook("西游记");
        proxyUser.addBook("水浒传");

        ProxyUser proxyUser1 = new ProxyUser(normal1);
        proxyUser1.borrowedBook("水浒传");
        proxyUser1.addBook("西游记");


    }
    public static void main2(String[] args) {
        AdminIUserFactory adminUserFactory = new AdminIUserFactory();
        User admin = adminUserFactory.createUser("zhangsan", 20);

        NormalIUserFactory normalUserFactory = new NormalIUserFactory();
        User normal1 = normalUserFactory.createUser("lisi", 19);
        User normal2 = normalUserFactory.createUser("wangwu", 18);
    }

    public static void main1(String[] args) {
        User admin = new AdminUser("zhangsan", 20);
        User normal1 = new NormalUser("lisi", 19);
        User normal2 = new NormalUser("wangwu", 18);

    }
}
